<?php


namespace App\Services;


class WebstockSendMessage
{
    public static  function send($code,$type,$data){
        $client = new \App\Services\WebSocketClient();
        $client->connect('49.234.48.38', 9502, '/');
        $payload = json_encode(['code'=>$code,'type'=>$type,'data'=>$data]);
        $rs = $client->sendData($payload);
        if( $rs !== true ){
            return false;
        }else{
            return true;
        }
    }
}
